<?php
$this->breadcrumbs=array(
	'Văn bản - pháp luật',
);

$this->menu=array(
	array('label'=>'Create Vanban', 'url'=>array('create')),
	array('label'=>'Manage Vanban', 'url'=>array('admin')),
);
?>

<?php /*$this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$dataProvider,
	'itemView'=>'_view',
)); */?>
<?php
$this->breadcrumbs=array(
	'Văn bản - pháp luật'=>array('index'),
);

$this->menu=array(
	//array('label'=>'List Vanban', 'url'=>array('index')),
	//array('label'=>'Create Vanban', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('vanban-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<div id="tracu_content">
<h2>Tra cứu văn bản</h2>
<div class="bt_nangcao"><?php echo CHtml::link('<b>Tìm kiếm</b>','#',array('class'=>'search-button')) ?></div>
<div align="center" class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->
<div id="list_Vb">
<h2>Danh sách văn bản</h2>
<?php 
	$url=Yii::app()->request->baseUrl;
	$file=new Filevb();
	
	$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'vanban-grid',
	'dataProvider'=>$model->search(),
	'itemsCssClass' => 'table table-bordered',
    'summaryCssClass' => 'alert alert-info',
	'columns'=>array(
		'so_vb'=>array('name'=>'so_vb','htmlOptions'=>array('width'=>80,'style'=>'text-align:center')),
		'trich_yeu_VB'=>array(
			'name'=>'trich_yeu_VB',
			'value' => 'CHtml::link($data->trich_yeu_VB,Yii::app()->createUrl("vanban/view",array("id"=>$data->id)))',
			'type'=>'raw',
			'htmlOptions'=>array('width'=>350,),
		),
		'ngay_phat_hanh'=>array(
			'name'=>'ngay_phat_hanh',
			'htmlOptions'=>array('width'=>115,'style'=>'text-align:center'),
		),
		array(
		
			'class'=>'CButtonColumn','header'=>'','template'=>'{downLoad}',
			 'buttons'=>array(
				'downLoad'=>array(
					'label'=>'Tải về',
					'imageUrl'=>Yii::app()->request->baseUrl.'/images/download.png',
					'url'=>'Yii::app()->createUrl("vanban/down", array("id"=>$data->id))',
					'visible'=>'$data->id != 1',
				),
				'view'=>array(
					'label'=>'Chi tiết',
					'imageUrl'=>Yii::app()->request->baseUrl.'/images/view.png',
					'url'=>'"#"',
					'url'=>'Yii::app()->createUrl("vanban/view", array("id"=>$data->id))',
					'visible'=>'$data->id != 1',
				),
			 )
		),
	),
)); ?>
</div>
</div>
<?php
	echo 'Noi dung moi them vao';
?>
